package Tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import Entities.Entity;
import fightSequencing.Fight;

public class aFightShould {

	@Test
	public void testFight() {
		Fight fight = new Fight();
		System.out.println();
		assertEquals(1, fight.getFightSerialNumber());
		fight = null;
	}

	@Test
	public void testFightPlayerEntityMobEntity() {
		Entity player = new Entity();
		player.setName("Bob");
		Entity bossmob = new Entity();
		bossmob.setName("Jim");
		Fight fight = new Fight(player, bossmob, 63780);
		assertEquals(1, fight.getGroup().size());
		assertEquals(1, fight.getIndexOfNextPlayer());
		assertEquals("Jim", fight.getMob().getName());
		fight = null;
	}

	@Test
	public void addPlayerToGroupShouldNotAddAPlayerThatExists() {
		Entity player = new Entity();
		player.setName("Bob");
		Entity bossmob = new Entity();
		bossmob.setName("Jim");
		Fight fight = new Fight(player, bossmob, 63780);
		fight.addPlayerToGroup(player);
		assertEquals(1, fight.getGroup().size());
		fight = null;

	}

	@Test
	public void testSetFightSerialNumber() {
		Fight fight = new Fight();
		System.out.println();
		assertEquals(1, fight.getFightSerialNumber());
		fight = null;

	}
	
	@Test
	public void testFightTimer() {
		Entity player = new Entity();
		player.setName("Bob");
		Entity bossmob = new Entity();
		bossmob.setName("Jim");
		Fight fight = new Fight(player, bossmob, 63780);
		assertEquals(63780, fight.getTimer().getStartTime());
		fight = null;
	}
	
	@Test
	public void testFightTimerCorrectlySetsPlayerStartTimer() {
		Entity player = new Entity();
		player.setName("Bob");
		Entity bossmob = new Entity();
		bossmob.setName("Jim");
		Fight fight = new Fight(player, bossmob, 63780);
		assertEquals(63780, fight.getGroup().get(0).getTimer().getStartTime());
	}

}
